package com.dxf.sysadmin.controller;

import com.dxf.common.utils.ResultJson;
import com.dxf.sysadmin.entity.Clazz;
import com.dxf.sysadmin.entity.EvaluteItem;
import com.dxf.sysadmin.entity.qo.CourseQo;
import com.dxf.sysadmin.entity.qo.ItemQo;
import com.dxf.sysadmin.entity.qo.MyPage;
import com.dxf.sysadmin.service.EvaluteItemService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/admin/item")
@Api(tags  = "EvaluteItemController|评价选项控制器")
public class EvaluteItemController {

    @Autowired
    EvaluteItemService evaluteItemService;

    /**
     * @Description: 评价选项分页查询
     */
    @PostMapping("itemPage")
    @ApiOperation("评价选项分页查询")
    public ResultJson itemPage(@RequestBody ItemQo qry){
        return evaluteItemService.itemPage(qry);
    }

    /**
     * @Description: 更具id列表删除选项
     */
    @PostMapping("delete")
    @ApiOperation(value = "更具id列表删除选项")
    public ResultJson deleteItem(@RequestParam("list[]") List<Long> list){
        return evaluteItemService.deleteItem(list);
    }

    /**
     * @Description: 新增或者更新选项
     */
    @PostMapping("saveOrUpdate")
    @ApiOperation(value="新增或者更新选项")
    public ResultJson saveOrUpdateItem( @RequestBody EvaluteItem item){
        return evaluteItemService.saveOrUpdateItem(item);
    }
    

}
